#include<iostream>
#include "array.h"

Array::Array(){
  max_size = 16;
  cur_size = 0;
  array = new int[max_size];
}

Array::Array(Array &a){
  max_size = a.max_size;
  array = new int[max_size];
  for(int i=0;i<a.max_size;i++){
    array.push_back(a[i]);
  }
}


int & Array::operator[](int cur){
  if (cur>this.Getlen())
    return array[this.Getlen()-1];
  else
  return array[cur];
}

char MyString::operator[](unsigned short offset) const{
  if (offset>itslen)
  return itsMyString[itslen-1];
  else
  return itsMyString[offset];
}
